from rest_framework.generics import ListAPIView
from question.serializers.question_serializers import *
from question.models import *


class NewQuestionView(ListAPIView):
    queryset = Question.objects.all()
    serializer_class = QuestionNewSerializer

    def get_queryset(self):
        id = self.kwargs.get('pk')
        if id != '-1':
            return self.queryset.filter(pk=id)

        return self.queryset.all()


class HotQuestionView(ListAPIView):
    queryset = Question.objects.all()
    serializer_class = QuestionNewSerializer

    def get_queryset(self):
        id = self.kwargs.get('pk')
        if id != '-1':
            return self.queryset.filter(pk=id)

        return self.queryset.all()




class WaitQuestionView(ListAPIView):
    queryset = Question.objects.all()
    serializer_class = QuestionNewSerializer

    def get_queryset(self):
        id = self.kwargs.get('pk')
        if id != '-1':
            return self.queryset.filter(pk=id)

        return self.queryset.all()